Skip to content

chore(mcp): add tsc build pipeline + convert small lib utilities to TypeScript (Phase 1 of #7291) - #7409

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
oktofeesh1:claude/issue-7328-mcp-phase1
Jul 20, 2026
Merged

chore(mcp): add tsc build pipeline + convert small lib utilities to TypeScript (Phase 1 of #7291)#7409
JSONbored merged 2 commits into
JSONbored:mainfrom
oktofeesh1:claude/issue-7328-mcp-phase1

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

  • Adds packages/loopover-mcp/tsconfig.json and switches the package's build script from a node --check-only chain to a real tsc compile (in-place .ts -> .js emit, import paths unchanged), plus a glob-driven scripts/check-syntax.mjs syntax-verification pass -- mirroring packages/loopover-miner's own build pipeline exactly (build:tsc && build:verify).
  • Converts the four smallest, lowest-risk lib/ files to real TypeScript: cli-error.js, format-table.js, redact-local-path.js, telemetry.js.
  • No published-package shape change: declaration: false (no new .d.ts artifact type) and "!lib/**/*.ts" / "!scripts/check-syntax.mjs" exclusions in package.json's files keep the npm tarball's file list byte-identical to before -- verified against test/unit/check-mcp-package.test.ts's allowlist.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves.

Closes #7328

Validation

  • git diff --check (against origin/main, matching CI's changes job exactly -- see Notes)
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally -- 100% lines/branches/functions on all 4 converted files, including a new test/unit/mcp-cli-error.test.ts for cli-error.js (previously untested at all) and added branch-coverage tests to test/unit/format-table.test.ts.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Not skipped, but note: npm audit --audit-level=moderate reports a pre-existing high-severity adm-zip advisory (no fix available) via github-actionlint, inherited unchanged from main and unrelated to this PR's packages/loopover-mcp scope.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A -- no such changes.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A -- pure internal helper refactor, no MCP tool surface changed.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A -- no UI changes.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

Notes

  • No behavior change, as the issue requires: every converted function's runtime logic and exported signature is unchanged from the original hand-written .js.
  • This supersedes a first attempt (PR chore(mcp): add tsc build pipeline + convert small lib utilities to TypeScript (Phase 1 of #7291) #7404) that was auto-closed: tsc's printer left a trailing space at the end of format-table.js's compiled renderRow line because a comment sat between => and its expression body in the .ts source -- caught by CI's git diff --check gate (bare local git diff --check doesn't catch this since it only diffs uncommitted changes, not the full PR diff against origin/main; another contributor hit the identical tsc-printer quirk elsewhere in this repo, e.g. de94afbb8). Fixed by hoisting the comment above the declaration.
  • Three existing test files (format-table.test.ts, redact-local-path.test.ts, mcp-local-telemetry.test.ts) had a @ts-expect-error suppression for dynamically importing what was previously an untyped .js module; these are now stale (TypeScript resolves the import to the new .ts source directly) and were removed.

@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner July 20, 2026 07:28
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

…ypeScript

Adds packages/loopover-mcp/tsconfig.json and switches the package's build
script from a node --check-only chain to a real tsc compile (in-place
.ts -> .js emit, import paths unchanged) plus a glob-driven syntax
verification pass, mirroring loopover-miner's own build pipeline.

Converts the four smallest, lowest-risk lib files: cli-error.js,
format-table.js, redact-local-path.js, telemetry.js.

Refs JSONbored#7328
…d format-table.js

tsc's printer left a trailing space at the end of renderRow's arrow-function
line when a comment sat between => and its expression body in the .ts
source -- caught by CI's git diff --check gate. Hoists the comment above
the declaration instead; no behavior change.
@JSONbored
JSONbored force-pushed the claude/issue-7328-mcp-phase1 branch from 1ec76d4 to 630076d Compare July 20, 2026 07:36
@JSONbored JSONbored added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 20, 2026
@JSONbored
JSONbored merged commit 0d896ce into JSONbored:main Jul 20, 2026
4 checks passed
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.22%. Comparing base (218a5ae) to head (630076d).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7409   +/-   ##
=======================================
  Coverage   91.21%   91.22%           
=======================================
  Files         716      716           
  Lines       72789    72793    +4     
  Branches    20858    20881   +23     
=======================================
+ Hits        66392    66402   +10     
+ Misses       5355     5349    -6     
  Partials     1042     1042           
Flag Coverage Δ
shard-1 32.06% <0.00%> (-3.84%) ⬇️
shard-2 41.70% <8.33%> (+0.35%) ⬆️
shard-3 37.57% <48.33%> (-1.39%) ⬇️
shard-4 42.91% <11.66%> (+2.99%) ⬆️
shard-5 34.75% <40.00%> (+7.60%) ⬆️
shard-6 25.05% <0.00%> (-6.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-mcp/lib/cli-error.ts 100.00% <100.00%> (ø)
packages/loopover-mcp/lib/format-table.ts 100.00% <100.00%> (ø)
packages/loopover-mcp/lib/redact-local-path.ts 100.00% <100.00%> (ø)
packages/loopover-mcp/lib/telemetry.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

jaytbarimbao-collab added a commit to jaytbarimbao-collab/gittensory that referenced this pull request Jul 20, 2026
…Nbored#7291)

Convert packages/loopover-mcp/lib/local-branch.js to real TypeScript,
using the tsc build pipeline landed in Phase 1 (JSONbored#7409). Types only;
runtime behavior is byte-identical (the compiled lib/local-branch.js
changes only in tsc formatting and the elision of an already-dead
node:path `join` import).

Add unit coverage for the local scorer-preview machinery (previously
untested in the .js) so the newly-typed file clears codecov/patch, and
mark the handful of provably-unreachable defensive fallbacks with
`v8 ignore` directives (the pattern already used across the converted
packages/loopover-miner/lib TypeScript files).

Remove the now-unused `@ts-expect-error package helper is plain JS`
directives above the dynamic local-branch.js imports in
test/unit/local-branch.test.ts and test/unit/local-scorer-adapter.test.ts,
which now resolve to the typed .ts source.

Closes JSONbored#7329
loopover-orb Bot pushed a commit that referenced this pull request Jul 20, 2026
…overage (#7472)

The comment above the packages/loopover-mcp/lib/**/*.js coverage.include entry said
lib/cli-error.js had no in-process test. That stopped being true when #7409 added
test/unit/mcp-cli-error.test.ts, which imports cli-error.js in-process and exercises
all three of its exports. Correct the sentence so it reflects that all five of the
package's lib/ files now have in-process tests. Comment-only; no glob or behavior change.

Closes #7435
@github-actions github-actions Bot mentioned this pull request Jul 20, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(mcp): add tsc build pipeline + convert small lib utilities to TypeScript (Phase 1 of #7291)

2 participants